package com.youths.service.impl;

import com.youths.dao.HeightInfoMapper;
import com.youths.domain.HeightInfo;
import com.youths.service.HeightInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by IntelliJ IDEA.
 * User: KingRainGrey
 * Date: 2020/7/12
 */
@Service
public class HeightInfoServiceImp implements HeightInfoService {
    @Autowired(required = false)
    HeightInfoMapper heightInfoMapper;

    @Override
    public int addHeightInfo(HeightInfo heightInfo) {
        int result = heightInfoMapper.add(heightInfo);
        if (result > 0) {
            return heightInfo.getHeightId();
        }
        return 0;
    }

    @Override
    public HeightInfo query(Integer recoId) {
        return heightInfoMapper.query(recoId);
    }

    @Override
    public int updateHeightInfo(HeightInfo heightInfo) {
        return heightInfoMapper.updateHeightInfo(heightInfo);
    }
}
